package com.easy.service.impl;

import com.easy.bean.Orderdetails;
import com.easy.dao.OrderdetailsDao;
import com.easy.service.IOrderdetailsService;
import com.easy.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderdetailsService implements IOrderdetailsService {
    @Autowired
    OrderdetailsDao orderdetailsDao;
    @Override
    public List<Orderdetails> getOrderdetailsList(Page page, String text) {
        return orderdetailsDao.getOrderdetailsList(page,text);
    }

    @Override
    public int OrderdetailsCount(String text) {
        return orderdetailsDao.OrderdetailsCount(text);
    }

    @Override
    public int addOrderdetails(Orderdetails orderdetails) {
        return orderdetailsDao.addOrderdetails(orderdetails);
    }

    @Override
    public int editOrderdetails(Orderdetails orderdetails) {
        return orderdetailsDao.editOrderdetails(orderdetails);
    }

    @Override
    public int deleteOrderdetails(int orderid, int proid) {
        return orderdetailsDao.deleteOrderdetails(orderid,proid);
    }

    @Override
    public List<Orderdetails> getOrderdetailsById(int orderid) {
        return orderdetailsDao.getOrderdetailsById(orderid);
    }

    @Override
    public double totalOrderdetailsPrice(int orderid) {
        return orderdetailsDao.totalOrderdetailsPrice(orderid);
    }

    @Override
    public int insertOrderdetails(int userid, int orderid) {
        return orderdetailsDao.insertOrderdetails(userid,orderid);
    }
}
